import { DialogForm } from 'custom/index'
import { addMaterialFile, updateMaterialFile } from './api'
import UrlItem from './components/UrlItem.vue'

const addDialog = new DialogForm('DialogForm')

addDialog
  .title('新增')
  .postApi(addMaterialFile)
  .useGroup('')
    .useItem('name').label('文件名').required().end()
    .useCustomItem(UrlItem, 'fileId').label('文件').required().end()

const editDialog = new DialogForm('DialogForm')
editDialog
  .title('编辑')
  .postApi(updateMaterialFile)
  .useGroup('')
    .useItem('name').label('文件名 ').required().end()
    .useCustomItem(UrlItem, 'fileId').label('文件').required().end()

export { addDialog, editDialog }
